//
//  YJBookItem.m
//  TianTianKankan
//
//  Created by sunmingming on 14-8-21.
//  Copyright (c) 2014年 Ebola. All rights reserved.
//

#import "YJBookItem.h"
#import <LKDBHelper.h>

@implementation YJBookItem

//重载选择 使用的LKDBHelper
+(LKDBHelper *)getUsingLKDBHelper
{
    static LKDBHelper* db;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        //        NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"book" ofType:@"db"];
        NSString* dbpath = [[NSBundle mainBundle] pathForResource:@"book" ofType:@"db"];
        NSLog(@"%@",dbpath);
        db = [[LKDBHelper alloc]initWithDBPath:dbpath];
        //or
        //        db = [[LKDBHelper alloc]init];
    });
    return db;
}

//在类 初始化的时候
+(void)initialize
{
    //enable the column binding property name
    //    [self setTableColumnName:@"id" bindingPropertyName:@"pid"];
}

//主键
+(NSString *)getPrimaryKey
{
    return @"Page";
}

//表名
+(NSString *)getTableName
{
    return @"BookCatalog";
}

//表版本
+(int)getTableVersion
{
    return 1;
}

@end
